package us.versus.them.weeds.constraints;

import flash.display.Graphics;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Point;
import flash.Lib;

import us.versus.them.weeds.Vertlet;

class Heigth implements Constraint {
	var y:Float;
	var vertlet:Vertlet;
	var strength:Float;

	public function new( vertlet:Vertlet, ?strength:Float ) {
		this.y = vertlet.current.y;
		this.vertlet = vertlet;
		this.strength = if ( 0 == strength ) { 0.05; } else { strength; };
	}

	public function enforce() {
		vertlet.current.y += strength * ( y - vertlet.current.y );
	}
}
